from reward_component import RewardComponent

class CustomerSatisfactionComponent(RewardComponent):
    """客户满意度奖励组件"""
    def __init__(self, weight=1.0, satisfaction_data=None):
        super().__init__(weight)
        self.satisfaction_data = satisfaction_data or {}
        
    def calculate(self, current_activity, next_activity, case_events, context=None):
        # 从满意度数据中获取活动评分
        satisfaction_score = self.satisfaction_data.get(next_activity, 0) / 10.0  # 归一化到0-1
        return satisfaction_score
    
    def get_description(self):
        return "基于客户满意度的奖励"